# import  math
#
# a = int(input("请输入边长a："))
# b = int(input("请输入边长b："))
# c = int(input("请输入边长c："))
#
# if a>0 and b>0 and c>0 :
#     if a+b>c and a+c>b and b+c>a:
#         p = (a + b + c) / 2
#         s = math.sqrt(p * (p - a) * (p - b) * (p - c))
#         print("这个三角形的面积是：",s)
#     else:
#         print("该形式不组成三角形")
# else:
#     print("该形式的三边不合法")
# #计算半边长
# p = (a+b+c)/2
# #计算面积
# s = math.sqrt(p*(p-a)*(p-b)*(p-c))
# print(s)
#####用户登录####


# for i in range(3):
#     username = input("请输入你的用户名：")
#     password = input("请输入你的密码：")
#     if username != "root":
#         print("用户名不正确")
#         print(f"你还可以尝试{2-i}次")
#     elif password != "123456":
#         print("密码错误")
#         print(f"你还可以尝试{2-i}次")
#     else :
#         print("登录成功")
#         break
# str1 = str(input("请输入一个字符串："))
# for i in str1:
#     if i.isupper():
#         print("1",end="")
#     elif i.islower():
#         print("0",end="")
#     else:
#         print("",end="")
# import random
# price_num = random.randrange(0,30)
# for i in range(3):
#     number = input("猜猜这个数字是多少（0-30）：")
#     if number.isdigit():
#         if int(number) == price_num :
#             print(f"恭喜你，猜中了,你用了{i+1}次")
#             break
#         elif int(number) > price_num :
#             print(f"老哥，数字大了,你还有{2-i}次机会")
#         elif int(number) < price_num :
#             print(f"老哥，数字小了，再接再厉，你还有{2-i}次机会")
#     else:
#         print("老哥，麻烦输入一个数字，别搞")
#         break

# for i in range(1,10):
#     for j in range(1,i+1):
#         print(f"{j}x{i}={i*j}",end=" ")
#         j += 1
#     print()
# for i in range(100,1000):
#     a = str(i)
#     if i == (int(a[0])**3+int(a[1])**3+int(a[2])**3):
#         print(i,end=" ")

# lst = [3,2,7,5,8,1]
# target = 9
# for i in range(len(lst)):
#      for j in range(len(lst[i:])):
#         if lst[i] + lst[j+i] == target:
#             print(f"{i} {j+i}")
#         else :
#             pass
# def bmi(s,w):
#     bmi = w /s**2
#     return  bmi
# bi = bmi(1.67,65)
# print(bi)
# def fun03(name,age,sex="f"):
#     print(f"my name is {name},age is {age},sex is {sex}")
#
# fun03("wenyao",18)
# fun03("wenyao",18,'testm')
# fun03("wenyao",age=19,sex="testm")
# fun03(sex="testm",name="wenyao",age=20)

# def maxnum_test(x,y):
#     print("return")
#     if x>y:
#         print("return x")
#         return x,y
#     else:
#         print("return y")
#         return
#     print("return1")
# t1 = maxnum_test(2,3)
# print(t1)
# t2 = maxnum_test(4,3)
# print(t2)
# t3,t4 = maxnum_test(4,3)
# print(t3)
# print(t4)
######匿名函数######
#不需要创建函数名
#只能有一个表达式，不用写return，该表达式的结果就是返回值

#lambda args1，args2 ： args1 + args2

# def add(a,b):
#     return a+b
# add2 = lambda a,b :a+b
# print(add(2,3))
# print(add2(2,3))
#
# s = lambda x,y :x if x > y else y
# print(s(4,3))

################递归函数############
# def factorial_func(n):
#     if n == 1:
#         return  1
#     return n*factorial_func(n-1)
























































